package software.agileCourse2013.KillerGame.utils;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;

import org.springframework.context.ApplicationContext;
import org.springframework.web.context.ContextLoaderListener;
import org.springframework.web.context.support.WebApplicationContextUtils;

public class SpringLoaderListener extends ContextLoaderListener{
    
    @Override
    public void contextInitialized(ServletContextEvent event) {
        super.contextInitialized(event);
        ServletContext context=event.getServletContext();
        ApplicationContext ctx=WebApplicationContextUtils.getRequiredWebApplicationContext(context);
        SpringContextutil.setContext(ctx);
        
    }

}